package common

import (
	"context"
	"encoding/json"

	"github.com/zeromicro/go-zero/core/logc"
)

func LogDebugJSON(ctx context.Context, l string, data interface{}) {
	if l == "debug" {
		jsonData, err := json.Marshal(data)
		if err != nil {
			logc.Errorf(ctx, "json格式化错误:%v", err)
		}
		logc.Debugf(ctx, "%s", string(jsonData))
		return
	}
}
